<template>
  <div>
    <p class="p1">展示</p>
    <button @click="black">黑色</button>
    <button @click="gules">红色</button>
  </div>
</template>

<script setup>
import { reactive, ref, toRefs } from 'vue';

let state = reactive({
  color: "#000"
})

let black = () => {
  state.color = "#000"
}
let gules = () => {
  state.color = "red"
}

</script>
<style scoped lang ='less'>
.p1 {
  color: v-bind("state.color");
}
</style>